﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;

namespace Dnsresolver
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }

        private DnsListener _dnsListener;
        

        private void TestButton_Click(object sender, EventArgs e)
        {
            _dnsListener.ResolveHost(HostTextBox.Text, new IPEndPoint(IPAddress.Parse("202.101.103.55"), 53));
        }

        private void MainForm_Load(object sender, EventArgs e)
        {
            _dnsListener = new DnsListener();
            _dnsListener.StartService();
        }

        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            _dnsListener.ShutDownService();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int? x=null;
            int? y=null;
            int? z = x*y;
            int? a=null;
            Console.WriteLine(x*y>=1);
        }
    }
}
